# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.

class ApplicationController < ActionController::Base
  helper :all # include all helpers, all the time
  protect_from_forgery # See ActionController::RequestForgeryProtection for details

  # Scrub sensitive parameters from your log
  # filter_parameter_logging :password
    
  include AuthenticatedSystem
  include ExceptionLoggable

  #判断是否登录
  def login_required
    unless logged_in?
      store_location
      redirect_to login_path
    end
  end
  
  def assert_current_user?
    return false unless logged_in?
  	current_user.id == params[:id].to_i
  end
  
  private

  def local_request?
    false
  end

end
